//
//  InputShareUserViewController.m
//  SenMo
//
//  Created by ZengYuan on 15/12/24.
//  Copyright © 2015年 ZengYuan. All rights reserved.
//

#import "InputShareUserViewController.h"

#import "DeviceHandle.h"

@interface InputShareUserViewController ()

@end

@implementation InputShareUserViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.titleLabel.text = @"分享用户";
    
    UIImage *streImage = [[UIImage imageNamed:@"y_btn"] resizableImageWithCapInsets:UIEdgeInsetsMake(6, 10, 6, 10)];
    [sureBtn setBackgroundImage:streImage forState:UIControlStateNormal];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

-(IBAction)shareUser:(id)sender{

    if(userField.text.length == 0){
        MBALERT(@"请输入用户id");
        return;
    }

    [DeviceHandle deviceShare:self.smartdevice.device_id userid:userField.text success:^{
        MBALERT(@"分享成功");
    } failure:^(NSString *error) {
        MBALERT(@"分享失败");
    }];
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
